<template>
  <Promised :promise="fieldsAsync">
    <template v-slot:pending>
      <!-- <CardSkeleton title="" /> -->
    </template>
    <template v-slot>
      <a-card class="card" v-if="fieldIndex > -1" title="审核意见" :bordered="false">
        <!-- 后台人工审核 -->

        <!-- 贷款审核 -->
        <!--  -->
        <HandlerForm
          v-if="fieldIndex === 0"
          :field="formFields[0]"
          :work-details="workDetails"
          @update="$emit('update')"
        />

        <!-- 拨款审核 -->
        <AppropriationForm
          v-if="fieldIndex === 1"
          :field="formFields[fieldIndex]"
          :work-details="workDetails"
          @update="$emit('update')"
        />
      </a-card>
    </template>
  </Promised>
</template>

<script>
import AppropriationForm from './Appropriation'
import HandlerForm from './Handler'
import form from './form'
import props from '../props'

export default {
  mixins: [form, props],

  computed: {
    tid () {
      return this.$route.params.tid
    },
  },

  components: {
    AppropriationForm,
    HandlerForm,
  },
}

</script>
